package com.ct.gd.passport.domain;

import com.ct.gd.passport.common.connect.CtServer;
import com.ct.gd.passport.common.constants.Protocol;
import com.ct.gd.passport.util.Util;
import com.fuckhtc.gson.Gson;
import com.up91.common.android.connect.Params;

public class TicketBookingInfo {
    public String serial;
    public String name;
    public String phone;
    public int adultCount;
    public int childCount;

    public boolean submit() {
        Params params = new Params();
        params.put(Protocol.Fields.TICKET_BOOKING_SERIAL, serial);
//        params.put(Protocol.Fields.TICKET_BOOKING_NAME, name);
        params.put(Protocol.Fields.TICKET_BOOKING_NAME, Util.changeCharset(name,"UTF-8"));
        params.put(Protocol.Fields.TICKET_BOOKING_PHONE, phone);
        params.put(Protocol.Fields.TICKET_BOOKING_ADULT_COUNT, adultCount);
        params.put(Protocol.Fields.TICKET_BOOKING_CHILD_COUNT, childCount);
        String json = CtServer.getServer().doGet(Protocol.Commands.TICKET_BOOKING_INFO_SUBMIT, params);
        return new Gson().fromJson(json, boolean.class);
    }
}
